package Opter;

import Libray.Book;
import Libray.BookShelf;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-04-16
 * Time: 17:48
 */
public class AddOpter implements IOpter{
    @Override
    public void opterFun(BookShelf bookShelf, String name) {
        // 输入
        Scanner scan = new Scanner(System.in);
        Book[] books = bookShelf.getBooks();
        System.out.println("请输入书籍信息: ");
        books[bookShelf.getBookNum()] = new Book(scan.next(), scan.next(), scan.nextInt(),
                scan.nextInt(), scan.nextInt(),false);
        bookShelf.setBookNum(bookShelf.getBookNum() + 1);
        System.out.println("已完成");
    }
}
